/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			main_tests.cc
  \date			Jul 2011
  \author		TNick

  \brief		Contains test application's entry point


*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

#include	<QApplication>
#include	<QDebug>

#include	<txlist.h>
#include	<tree3d.h>

#include	<objdeflib.h>
#include	<session.h>

#include	<objdef.h>
#include	<attdef.h>
#include	<cmndata.h>
#include	<action.h>

/*  INCLUDES    ============================================================ */
//
//
//
//
/*  DATA    ---------------------------------------------------------------- */





/*  DATA    ================================================================ */
//
//
//
//
/*  FUNCTIONS    ----------------------------------------------------------- */

/* ------------------------------------------------------------------------- */
int			main				( int argc, char *argv[] )
{
#ifndef	OBJECTSLIB_TESTS
	qDebug() << "Build error. Test must have OBJECTSLIB_TESTS defined.";
	return -1;
#endif

	qDebug() << "";
	qDebug() << "-----------------------------------------------------------";
	qDebug() << "----             Objects tests started                ----";
	qDebug() << "-----------------------------------------------------------";
	qDebug() << "";

	/* prepare to start */
	QApplication apl(argc, argv);
	Q_UNUSED( apl );

	/* prepare the ground for easy access to settings */
	QCoreApplication::setOrganizationName( "TNick" );
	QCoreApplication::setOrganizationDomain( "sites.google.com/site/tnickweb/" );
	QCoreApplication::setApplicationName( "PgScript_tests" );

	/* start the library */
	ObjD::initialise();

	int performed = 0;
	int succeded = 0;
	int crt_performed = 0;
	int crt_succeded = 0;
	//QString	Outcm;


	Tree3D_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	TxList_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	ObjD::Session_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	ObjD::CmnData_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	ObjD::AttDef_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	ObjD::Action_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;

	ObjD::ObjDef_Tests( crt_performed, crt_succeded );
	Q_ASSERT( crt_succeded <= crt_performed );
	performed += crt_performed;
	succeded += crt_succeded;



	/* stop the library */
	ObjD::terminate();


	qDebug() << "";
	qDebug() << "-----------------------------------------------------------";
	qDebug() << "----             Objects tests completed              ----";
	qDebug() << "-----------------------------------------------------------";
	qDebug() << "Succesfull tests: " << succeded;
	qDebug() << "Failed tests:     " << ( performed - succeded );
	qDebug() << "Total number of tests performed: " << performed;
	qDebug() << "-----------------------------------------------------------";
	qDebug() << "";
	return ( performed == succeded ? 0 : -1 );
}
/* ========================================================================= */

/*  FUNCTIONS    =========================================================== */
//
//
//
//
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
